package com.jueban.Vo;

import com.jueban.model.ApplyOfIP;
import com.jueban.model.State;
import com.jueban.model.ApplyInfo;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

@Getter
@Setter
public class ApplyOfIPVo extends ResultVo {

    private Integer id;

    private String finallyIPName;//最终专利名称

    private State state;//申请状态

    private String applicant;

    private ApplyInfo applyInfo;//申请表资料(见知识产权申请表)

    private String informationPath;//申请材料路径(doc文件)

    private String proxyFormPath;//代理通知书路径(pdf文件)

    private SuggestVo departmentSuggest;//部门意见

    private SuggestVo researchSuggest;//学术委员会意见(一般为null)

    private SuggestVo academicSuggest;//科研处意见

    private String identifier;

    ApplyOfIPVo(ApplyOfIP applyOfIP) {
        setProperties(applyOfIP);

    }

    public ApplyOfIPVo() {
    }

    public void setProperties(ApplyOfIP applyOfIP) {
        BeanUtils.copyProperties(applyOfIP, this, "state", "applicant"
                , "departmentSuggest", "researchSuggest", "academicSuggest");
        this.state = applyOfIP.getState();
        this.applicant = applyOfIP.getApplicant().getName();
        departmentSuggest = new SuggestVo(applyOfIP.getDepartmentSuggest());
        researchSuggest = new SuggestVo(applyOfIP.getResearchSuggest());
        academicSuggest = new SuggestVo(applyOfIP.getAcademicSuggest());
    }

}
